package com.liwang.lanouhn.nvshengo.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.liwang.lanouhn.nvshengo.R;
import com.liwang.lanouhn.nvshengo.view.BarrageRelativeLayout;

import java.util.LinkedList;

/**
 * Created by lanouhn on 2016/10/21.
 */
public class DanmuFragment extends Fragment {
    private BarrageRelativeLayout barrageRelativeLayout;
    String[] itemText = {"主播好漂亮...", "你是哪里人啊", "主播你的胸好大啊","都在干嘛呢","喜欢主播的点下赞","主播声音好好听，，，",
            "这是我老婆，，", "李晓峰我知道你在看，别装啦", "这么丑还能出来当主播", "主播萌的有...点二", "主播跳个舞、、、吧",
            "主播唱...个歌呗","水饺多少钱一晚...","你柰子这么大，你爸爸知道吗？","你可要摸着良心直播哈！！！！","都瞪大眼睛，，主播要直播下面啦...",
            "主播发福利啦，，，","fans群号多少啊，主播加我QQ啊啊啊！！","打算了可；实例；‘","多少级了可怕；离开； ","搜客；’。‘吗","好高好高的深V很快就"};

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.danmu, null);
        initView(view);
        return view;
    }

    private void initView(View view) {
        barrageRelativeLayout= (BarrageRelativeLayout) view.findViewById(R.id.butttonPanel);
        LinkedList<String> texts =new LinkedList<String>();
        for (int i=0;i<itemText.length;i++){
            texts.add(itemText[i]);
        }
        barrageRelativeLayout.setBarrageTexts(texts);
        barrageRelativeLayout.show(BarrageRelativeLayout.RANDOM_SHOW);
    }

}
